/*
 * Copyright @ 2024 weili23
 * com.example.mythread.a01threadcase 15:15
 * All right reserved.
 */

package com.example.mythread.a01threadcase;

/**
 * @desc:
 * @author: weili23
 * @createTime: 2024/10/16 15:15
 * @version: v1.0
 */
public class ThreadDemo {
    public static void main(String[] args){
        /*
         * 多线程的第一种方式 继承thread
         * 1. 定义类继承Thread
         * 2. 重写run方法
         * 3. 创建子类的对象并启动
         *
         */
        MyThread t1 = new MyThread();
        MyThread t2 = new MyThread();
        t1.setName("线程1");
        t2.setName("线程2");
        t1.start();
        t2.start();
    }
}
